import Vue from "vue";
import App from "./App.vue";

//引入注册全局组件
import NavType from '@comp/NavType'
import Swiper from '@comp/Swiper'
import Pagenation from '@comp/Pagenation'

import store from '@/store'

//引入router对象
import router from "@/router";

//引入mockServer,使用mockjs模拟
import '@/mock/mockServer.js'

Vue.config.productionTip = false;

//注册全局组件
Vue.component('NavType',NavType)
Vue.component('Swiper',Swiper)
Vue.component('Pagenation',Pagenation)

new Vue({
  render: (h) => h(App),
  //把router路由对象注册到实例上，那么所有的组件实例上都有有一个$router和$route对象
  router,
  store,
  //创建事件总线，不能在mounted中，参考父子组件的生命周期
  beforeCreate(){
    Vue.prototype.$bus = this
  }
}).$mount("#app");

